def hash_table_search(hash_map, key):
    """
    哈希表查找：利用字典的O(1)查找特性
    hash_map：字典（哈希表）
    key：待查找键
    """
    return hash_map.get(key, -1)  # 存在返回值，否则返回-1

# 测试
hash_map = {"name": "Alice", "age": 25, "city": "Beijing"}
print(hash_table_search(hash_map, "age"))    # 输出：25
print(hash_table_search(hash_map, "gender")) # 输出：-1